#ifndef _drv_adc_init_h
#define _drv_adc_init_h

#include "n32g430.h"

#define VOLTAGE_ADC_CHANNEL  ADC_Channel_02_PA1   // 电压采样通道编号
#define CURRENT_ADC_CHANNEL  ADC_Channel_03_PA2   // 电流采样通道编号
#define EX_ADC_CHANNEL       ADC_Channel_13_PB11  //外部adc模拟量通道

#define CURRENT_FACTOR       (1.646382291543582F / 4.0)
#define VOLTAGE_FACTOR        8.471446586200685F


void DPM_AdcInit(void);
uint16_t DPM_AdcGet(uint8_t ADC_Channel);

double DPM_ExVoltageRead(void);
double DPM_InVoltageRead(void);
double DPM_CurrentRead(void);

#endif 

